﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="aboutTitle" ContentPlaceHolderID="TitleContent" runat="server">
	Quản lý nhân viên
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Quản lý nhân viên</h2>
    <% using (Html.BeginForm())
       { 
       Html.RenderPartial("QLNhanVienButton"); %>
    <div>
        <fieldset>
            <legend>Danh sách nhân viên</legend>
            <table>
                <tbody>
                    <tr>
                        <th><input type="checkbox" name="checkAll" /></th>
                        <th>ID</th>
                        <th>Tên đăng nhập</th>
                        <th>Email</th>
                        <th>Loại</th>
                        <th colspan="2"  align="center">Lựa chọn</th>
                    </tr>
                    <%
           Dictionary<int, string> Loai = (Dictionary<int, string>)ViewData["Loai"];
           foreach (DTO.NhanVienDTO nhanvien in (List<DTO.NhanVienDTO>)ViewData["dsNhanVien"])
           {  %>
                    <tr>
                        <td><input type="checkbox" name="check[<% Response.Write(nhanvien.Id); %>]" /></td>
                        <td><% Response.Write(nhanvien.Id); %></td>
                        <td><% Response.Write(nhanvien.TenDangNhap); %></td>
                        <td><% Response.Write(nhanvien.Email); %></td>
                        <td><% Response.Write(Loai[nhanvien.Loai]); %></td>
                        <td align="center"> <%: Html.ActionLink("Sửa", "Sua", "QLNhanVien", new { id = nhanvien.Id }, null)%></td>
                    </tr>
                    <%
           } %>
                </tbody>
            </table>
        </fieldset>
    </div>
    <% } %>
</asp:Content>
